﻿using HttpHelper;
using HttpHelper.CommonTools;
using Spiders.Entity.LgEntity;
using Spiders.UrlDefine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;

namespace Spiders.ClassForWitchSite
{
    public class LaGouSpider
    {
        public static void InitLgSpider()
        {
            string postdata = "first=true&pn=1&kd=WPF";
            string r = "https://www.lagou.com/jobs/list_Wpf?labelWords=&fromSearch=true&suginput=";
            HttpMethods.ReferUrl = r;
            CookieContainer c = HttpMethods.getCookie("http://www.lagou.com/");
            HttpMethods.Et = EContentType.ApplicationFromCode;

            HttpResponseResult Result = HttpMethods.PostData(string.Format(LaGouUrl.GetJob, HttpUtility.UrlEncode("北京")), postdata, c, Encoding.UTF8, null);
            if (Result.StatusCode == System.Net.HttpStatusCode.OK)
            {
                LGJobsEntity lje = JsonParase.JsonParse<LGJobsEntity>(Result.ContentData.ToString());
                string a = "https://restapi.amap.com/v3/geocode/regeo?key=ca71f341bd8d847d79b958d2c40b4532&s=rsv3&location=116.336647,39.977863&radius=500&callback=jsonp_167390_&platform=JS&logversion=2.0&sdkversion=1.3&appname=https%3A%2F%2Fwww.lagou.com%2Fjobs%2F3146397.html&csid=9A12B35A-4637-4824-822A-B84FEB025C1C";
            }

        }
    }
}
